//
//  ProductView.m
//  Cat
//
//  Created by lushitong on 2019/1/1.
//  Copyright © 2019年 lushitong. All rights reserved.
//

#import "ProductView.h"
#import "FLImageView.h"
#import "UIButton+EnlargeHitArea.h"
#import <Photos/Photos.h>

@interface ProductView()<FLImageViewDelegate>

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *label1;
@property (nonatomic, strong) UILabel *label2;
@property (nonatomic, strong) UILabel *label3;
@property (nonatomic, strong) UILabel *label4;
@property (nonatomic, strong) UILabel *label5;

@property (nonatomic, strong) UIImageView *downImageView;
@property (nonatomic, strong) UILabel *saveLabel;
@property (nonatomic, strong) UIButton *savaButton;

@property (nonatomic, strong) UIButton *shareButton; // 分享的button

@property (nonatomic, strong) FLImageView *image1;
@property (nonatomic, strong) FLImageView *image2;
@property (nonatomic, strong) FLImageView *image3;
@property (nonatomic, strong) FLImageView *image4;
@property (nonatomic, strong) FLImageView *image5;
@property (nonatomic, strong) FLImageView *image6;
@property (nonatomic, strong) FLImageView *image7;

@property (nonatomic, strong) UIButton *selctButton1;
@property (nonatomic, strong) UIButton *selctButton2;
@property (nonatomic, strong) UIButton *selctButton3;
@property (nonatomic, strong) UIButton *selctButton4;
@property (nonatomic, strong) UIButton *selctButton5;
@property (nonatomic, strong) UIButton *selctButton6;
@property (nonatomic, strong) UIButton *selctButton7;

@property (nonatomic, strong) ProductInfo *productModel;

@end

@implementation ProductView

- (void)setDeatilCoupon:(ShareCouponInfo *)couponInfo andProduct:(ProductInfo *)productModel {
	_productModel = productModel;
	self.titleLabel.text = productModel.title;
	self.label1.text = [NSString stringWithFormat:@"【在售价】 %@元",productModel.marketAmount];
	self.label2.text = [NSString stringWithFormat:@"【券后价】 %@元",productModel.buyPrice];
	self.label3.text = [NSString stringWithFormat:@"【下载喵象再省】 %@元",productModel.prizeAmount];
	self.label4.text = [NSString stringWithFormat:@"复制这条信息￥%@ ,打开【手机淘宝】即可查看",couponInfo.keyword];
	if (productModel.imgs.count <= 0) {return;}
	self.selctButton1.hidden = NO;
	[self.image1 setImageUrl:[NSURL URLWithString:[productModel.imgs safeObjectAtIndex:0]] size:CGSizeMake(kQKFitModuleDecimal(153), kQKFitModuleDecimal(241)) cornerRadius:0.0];
	if (productModel.imgs.count <= 1) {return;}
	self.selctButton2.hidden = NO;
	[self.image2 setImageUrl:[NSURL URLWithString:[productModel.imgs safeObjectAtIndex:1]] size:CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)) cornerRadius:0.0];
	if (productModel.imgs.count <= 2) {return;}
	self.selctButton3.hidden = NO;
	[self.image3 setImageUrl:[NSURL URLWithString:[productModel.imgs safeObjectAtIndex:2]] size:CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)) cornerRadius:0.0];
	if (productModel.imgs.count <= 3) {return;}
	self.selctButton4.hidden = NO;
	[self.image4 setImageUrl:[NSURL URLWithString:[productModel.imgs safeObjectAtIndex:3]] size:CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)) cornerRadius:0.0];
	if (productModel.imgs.count <= 4) {return;}
	self.selctButton5.hidden = NO;
	[self.image5 setImageUrl:[NSURL URLWithString:[productModel.imgs safeObjectAtIndex:4]] size:CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)) cornerRadius:0.0];
	if (productModel.imgs.count <= 5) {return;}
	self.selctButton6.hidden = NO;
	[self.image6 setImageUrl:[NSURL URLWithString:[productModel.imgs safeObjectAtIndex:5]] size:CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)) cornerRadius:0.0];
}

- (instancetype)initWithFrame:(CGRect)frame {
	self = [super initWithFrame:frame];
	if (self) {
		[self loadAllSubViews];
	}
	return self;
}

- (void)loadAllSubViews {
	[self addSubviews:@[self.titleLabel,self.label1,self.label2,self.label3,self.label4,self.label5,self.downImageView,self.saveLabel,self.savaButton,self.shareButton]];
	
	[self addSubviews:@[self.image1,self.image2,self.image3,self.image4,self.image5,self.image6,self.image7]];
	
	[self addSubviews:@[self.selctButton1,self.selctButton2,self.selctButton3,self.selctButton4,self.selctButton5,self.selctButton6,self.selctButton7]];
	
	[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.mas_left).offset(kQKFitModuleDecimal(12));
		make.right.equalTo(self.mas_right).offset(-kQKFitModuleDecimal(12));
		make.top.equalTo(self.mas_top).offset(kQKFitModuleDecimal(10));
	}];
	
	[self.label1 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.titleLabel.mas_left);
		make.top.equalTo(self.titleLabel.mas_bottom).offset(kQKFitModuleDecimal(2.0));
	}];
	
	[self.label2 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.titleLabel.mas_left);
		make.top.equalTo(self.label1.mas_bottom).offset(kQKFitModuleDecimal(2.0));
	}];
	
	[self.label3 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.titleLabel.mas_left);
		make.top.equalTo(self.label2.mas_bottom).offset(kQKFitModuleDecimal(2.0));
	}];
	
	[self.label4 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.titleLabel.mas_left);
		make.top.equalTo(self.label3.mas_bottom).offset(kQKFitModuleDecimal(18));
	}];
	
	[self.label5 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.titleLabel.mas_left);
		make.right.equalTo(self.mas_right).offset(-kQKFitModuleDecimal(12));
		make.top.equalTo(self.label4.mas_bottom).offset(kQKFitModuleDecimal(8));
	}];
	
	[self.downImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(24), kQKFitModuleDecimal(24)));
		make.left.equalTo(self.mas_left).offset(kQKFitModuleDecimal(105));
		make.top.equalTo(self.mas_bottom).offset(-kQKFitModuleDecimal(23 + 15));
	}];
	
	[self.saveLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.downImageView.mas_right);
		make.centerY.equalTo(self.downImageView.mas_centerY);
	}];
	
	[self.savaButton mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.downImageView.mas_left);
		make.right.equalTo(self.saveLabel.mas_right);
		make.height.equalTo(@(kQKFitModuleDecimal(23)));
		make.top.equalTo(self.saveLabel.mas_top);
	}];

	[self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.and.right.and.top.equalTo(self);
		make.bottom.equalTo(self.label5.mas_bottom);
	}];

	[self.image1 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.label4.mas_left);
		make.top.equalTo(self.label4.mas_bottom).offset(kQKFitModuleDecimal(30));
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(153), kQKFitModuleDecimal(241)));
	}];
	
	[self.image2 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)));
		make.left.equalTo(self.image1.mas_right).offset(kQKFitModuleDecimal(10.0));
		make.top.equalTo(self.image1.mas_top);
	}];
	
	[self.image3 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)));
		make.left.equalTo(self.image2.mas_right).offset(kQKFitModuleDecimal(10.0));
		make.top.equalTo(self.image2.mas_top);
	}];
	
	[self.image4 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)));
		make.left.equalTo(self.image1.mas_right).offset(kQKFitModuleDecimal(10.0));
		make.top.equalTo(self.image2.mas_bottom).offset(kQKFitModuleDecimal(10.0));
	}];
	
	[self.image5 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(77), kQKFitModuleDecimal(77)));
		make.left.equalTo(self.image4.mas_right).offset(kQKFitModuleDecimal(10.0));
		make.top.equalTo(self.image3.mas_bottom).offset(kQKFitModuleDecimal(10.0));
	}];
	
	[self.selctButton1 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(20.0), kQKFitModuleDecimal(20.0)));
		make.top.equalTo(self.image1.mas_top).offset(kQKFitModuleDecimal(5.0));
		make.right.equalTo(self.image1.mas_right).offset(-kQKFitModuleDecimal(5.0));
	}];
	
	[self.selctButton2 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(20.0), kQKFitModuleDecimal(20.0)));
		make.top.equalTo(self.image2.mas_top).offset(kQKFitModuleDecimal(5.0));
		make.right.equalTo(self.image2.mas_right).offset(-kQKFitModuleDecimal(5.0));
	}];
	
	[self.selctButton3 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(20.0), kQKFitModuleDecimal(20.0)));
		make.top.equalTo(self.image3.mas_top).offset(kQKFitModuleDecimal(5.0));
		make.right.equalTo(self.image3.mas_right).offset(-kQKFitModuleDecimal(5.0));
	}];
	
	[self.selctButton4 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(20.0), kQKFitModuleDecimal(20.0)));
		make.top.equalTo(self.image4.mas_top).offset(kQKFitModuleDecimal(5.0));
		make.right.equalTo(self.image4.mas_right).offset(-kQKFitModuleDecimal(5.0));
	}];
	
	[self.selctButton5 mas_makeConstraints:^(MASConstraintMaker *make) {
		make.size.equalTo(CGSizeMake(kQKFitModuleDecimal(20.0), kQKFitModuleDecimal(20.0)));
		make.top.equalTo(self.image5.mas_top).offset(kQKFitModuleDecimal(5.0));
		make.right.equalTo(self.image5.mas_right).offset(-kQKFitModuleDecimal(5.0));
	}];
}

- (void)titleLabelTapAction {
	UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
	pasteboard.string = [NSString stringWithFormat:@"%@\n%@\n%@\n%@\n%@",self.titleLabel.text,self.label1.text,self.label2.text,self.label3.text,self.label4.text];
	[FLProgressHUD showSuccess:@"复制成功"];
}

- (void)shareAction {
	[self saveShareImage];
}

- (void)saveShareImage {
	if (DeviceSystemVersion > 10.0) {
		[FLProgressHUD showMessageCenter:@"保存成功"];
		if (self.selctButton1.selected) {
			[self savePhoneWithUrl:self.productModel.imgs.firstObject];
		}
		
		if (self.selctButton2.selected) {
			[self savePhoneWithUrl:[self.productModel.imgs safeObjectAtIndex:1]];
		}
		if (self.selctButton3.selected) {
			[self savePhoneWithUrl:[self.productModel.imgs safeObjectAtIndex:2]];
		}
		
		if (self.selctButton4.selected) {
			[self savePhoneWithUrl:[self.productModel.imgs safeObjectAtIndex:3]];
		}
		
		if (self.selctButton5.selected) {
			[self savePhoneWithUrl:[self.productModel.imgs safeObjectAtIndex:4]];
		}
		
		if (self.selctButton6.selected) {
			[self savePhoneWithUrl:[self.productModel.imgs safeObjectAtIndex:5]];
		}
	} else {
		PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
		if (status != PHAuthorizationStatusAuthorized) {
			[FLProgressHUD showMessageCenter:@"请去【设置】中打开此APP的相册权限才能保存图片到相册"];
		}else {
			[FLProgressHUD showMessageCenter:@"保存成功"];
		}
	}
}

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
	if(error){
		[FLProgressHUD showError:@"保存图片失败"];
	} else{
		NSString *title = @"图片保存成功";
		[FLProgressHUD showSuccess:title];
	}
	
}

- (void)changSelectAction:(UIButton *)selectButton {
	 if (selectButton.tag == 101) {
		self.selctButton1.selected = !selectButton.selected;
	} else if (selectButton.tag == 102) {
		self.selctButton2.selected = !selectButton.selected;
	} else if (selectButton.tag == 103) {
		self.selctButton3.selected = !selectButton.selected;
	} else if (selectButton.tag == 104) {
		self.selctButton4.selected = !selectButton.selected;
	} else if (selectButton.tag == 105) {
		self.selctButton5.selected = !selectButton.selected;
	} else if (selectButton.tag == 106) {
		self.selctButton6.selected = !selectButton.selected;
	} else if (selectButton.tag == 107) {
		self.selctButton7.selected = !selectButton.selected;
	}
}

- (void)savePhoneWithUrl:(NSString*)urlString {
	NSData *data = [NSData dataWithContentsOfURL:[NSURL  URLWithString:urlString]];
	UIImage *image = [UIImage imageWithData:data]; // 取得图片
	
	[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
//		/写入图片到相册
		PHAssetChangeRequest *req = [PHAssetChangeRequest creationRequestForAssetFromImage:image];
	} completionHandler:^(BOOL success, NSError * _Nullable error) {
		NSLog(@"success = %d, error = %@", success, error);
	}];
}
#pragma mark-----  lazy init -----

- (UILabel *)titleLabel {
	if (!_titleLabel) {
		_titleLabel = [UILabel labelWithFont:[UIFont boldSystemFontOfSize:kQKFitFont(kQKFitFont(12))] textColor:COLOR_WITH_HEX(0x4C4947)];
		_titleLabel.numberOfLines = 0;
	}
	return _titleLabel;
}

- (UILabel *)label1 {
	if (!_label1) {
		_label1 = [UILabel labelWithFont:[UIFont systemFontOfSize:kQKFitFont(12)] textColor:COLOR_WITH_HEX(0x4C4947)];
	}
	return _label1;
}

- (UILabel *)label2 {
	if (!_label2) {
		_label2 = [UILabel labelWithFont:[UIFont systemFontOfSize:kQKFitFont(12)] textColor:COLOR_WITH_HEX(0x4C4947)];
	}
	return _label2;
}

- (UILabel *)label3 {
	if (!_label3) {
		_label3 = [UILabel labelWithFont:[UIFont systemFontOfSize:kQKFitFont(12)] textColor:COLOR_WITH_HEX(0x4C4947)];
	}
	return _label3;
}

- (UILabel *)label4 {
	if (!_label4) {
		_label4 = [UILabel labelWithFont:[UIFont systemFontOfSize:kQKFitFont(12)] textColor:COLOR_WITH_HEX(0x4C4947)];
		_label4.numberOfLines = 0;
	}
	return _label4;
}

- (UILabel *)label5 {
	if (!_label5) {
		_label5 = [UILabel labelWithFont:[UIFont systemFontOfSize:kQKFitFont(12)] textColor:COLOR_WITH_HEX(0xCDC7C4)];
		_label5.text = @"点击直接复制淘宝口令";
		_label5.userInteractionEnabled = YES;
		UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(titleLabelTapAction)];
		[_label5 addGestureRecognizer:gr];
	}
	return _label5;
}

- (UIImageView *)downImageView {
	if (!_downImageView) {
		_downImageView = [[UIImageView alloc] init];
		_downImageView.image = [UIImage imageNamed:@"share_down_pic"];
	}
	return _downImageView;
}

- (UILabel *)saveLabel {
	if (!_saveLabel) {
		_saveLabel = [UILabel labelWithText:@"保存图片到手机" font:[UIFont boldSystemFontOfSize:kQKFitFont(16)] textColor:COLOR_WITH_HEX(0x4C4947)];
	}
	return _saveLabel;
}

- (UIButton *)savaButton {
	if (!_savaButton) {
		_savaButton = [UIButton buttonWithType:UIButtonTypeCustom];
		[_savaButton addTarget:self action:@selector(saveShareImage) forControlEvents:UIControlEventTouchUpInside];
		[_savaButton setHitTestEdgeInsets:UIEdgeInsetsMake(-22, -22, -22, -22)];
	}
	return _savaButton;
}

- (UIButton *)shareButton {
	if (!_shareButton) {
		_shareButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
		[_shareButton addTarget:self action:@selector(titleLabelTapAction) forControlEvents:UIControlEventTouchUpInside];
	}
	return _shareButton;
}

- (FLImageView *)image1 {
	if (!_image1) {
		_image1 = [[FLImageView alloc] init];
		_image1.delegate = self;
	}
	return _image1;
}

- (FLImageView *)image2 {
	if (!_image2) {
		_image2 = [[FLImageView alloc] init];
		_image2.delegate = self;
	}
	return _image2;
}

- (FLImageView *)image3 {
	if (!_image3) {
		_image3 = [[FLImageView alloc] init];
		_image3.delegate = self;
	}
	return _image3;
}

- (FLImageView *)image4 {
	if (!_image4) {
		_image4 = [[FLImageView alloc] init];
		_image4.delegate = self;
	}
	return _image4;
}

- (FLImageView *)image5 {
	if (!_image5) {
		_image5 = [[FLImageView alloc] init];
		_image5.delegate = self;
	}
	return _image5;
}

- (FLImageView *)image6 {
	if (!_image6) {
		_image6 = [[FLImageView alloc] init];
		_image6.delegate = self;
	}
	return _image6;
}

- (FLImageView *)image7 {
	if (!_image7) {
		_image7 = [[FLImageView alloc] init];
		_image7.delegate = self;
	}
	return _image7;
}

- (UIButton *)selctButton1 {
	if (!_selctButton1) {
		_selctButton1 = [UIButton buttonWithType:UIButtonTypeCustom];
		[_selctButton1 setImage:[UIImage imageNamed:@"not_select"] forState:UIControlStateNormal];
		[_selctButton1 setImage:[UIImage imageNamed:@"select"] forState:UIControlStateSelected];
		[_selctButton1 addTarget:self action:@selector(changSelectAction:) forControlEvents:UIControlEventTouchUpInside];
		_selctButton1.tag = 101;
		_selctButton1.selected = YES;
		_selctButton1.hidden = YES;
		[_selctButton1 setHitTestEdgeInsets:UIEdgeInsetsMake(-20, -20, -20, -20)];
	}
	return _selctButton1;
}

- (UIButton *)selctButton2 {
	if (!_selctButton2) {
		_selctButton2 = [UIButton buttonWithType:UIButtonTypeCustom];
		[_selctButton2 setImage:[UIImage imageNamed:@"not_select"] forState:UIControlStateNormal];
		[_selctButton2 setImage:[UIImage imageNamed:@"select"] forState:UIControlStateSelected];
		_selctButton2.tag = 102;
		[_selctButton2 addTarget:self action:@selector(changSelectAction:) forControlEvents:UIControlEventTouchUpInside];
		_selctButton2.hidden = YES;
		[_selctButton2 setHitTestEdgeInsets:UIEdgeInsetsMake(-20, -20, -20, -20)];
	}
	return _selctButton2;
}


- (UIButton *)selctButton3 {
	if (!_selctButton3) {
		_selctButton3 = [UIButton buttonWithType:UIButtonTypeCustom];
		[_selctButton3 setImage:[UIImage imageNamed:@"not_select"] forState:UIControlStateNormal];
		[_selctButton3 setImage:[UIImage imageNamed:@"select"] forState:UIControlStateSelected];
		_selctButton3.tag = 103;
		[_selctButton3 addTarget:self action:@selector(changSelectAction:) forControlEvents:UIControlEventTouchUpInside];
		_selctButton3.hidden = YES;
		[_selctButton3 setHitTestEdgeInsets:UIEdgeInsetsMake(-20, -20, -20, -20)];
	}
	return _selctButton3;
}


- (UIButton *)selctButton4 {
	if (!_selctButton4) {
		_selctButton4 = [UIButton buttonWithType:UIButtonTypeCustom];
		[_selctButton4 setImage:[UIImage imageNamed:@"not_select"] forState:UIControlStateNormal];
		[_selctButton4 setImage:[UIImage imageNamed:@"select"] forState:UIControlStateSelected];
		_selctButton4.tag = 104;
		[_selctButton4 addTarget:self action:@selector(changSelectAction:) forControlEvents:UIControlEventTouchUpInside];
		_selctButton4.hidden = YES;
		[_selctButton4 setHitTestEdgeInsets:UIEdgeInsetsMake(-20, -20, -20, -20)];
	}
	return _selctButton4;
}



- (UIButton *)selctButton5 {
	if (!_selctButton5) {
		_selctButton5 = [UIButton buttonWithType:UIButtonTypeCustom];
		[_selctButton5 setImage:[UIImage imageNamed:@"not_select"] forState:UIControlStateNormal];
		[_selctButton5 setImage:[UIImage imageNamed:@"select"] forState:UIControlStateSelected];
		_selctButton5.tag = 105;
		[_selctButton5 addTarget:self action:@selector(changSelectAction:) forControlEvents:UIControlEventTouchUpInside];
		_selctButton5.hidden = YES;
		[_selctButton5 setHitTestEdgeInsets:UIEdgeInsetsMake(-20, -20, -20, -20)];
	}
	return _selctButton5;
}

- (UIButton *)selctButton6 {
	if (!_selctButton6) {
		_selctButton6 = [UIButton buttonWithType:UIButtonTypeCustom];
		[_selctButton6 setImage:[UIImage imageNamed:@"not_select"] forState:UIControlStateNormal];
		[_selctButton6 setImage:[UIImage imageNamed:@"select"] forState:UIControlStateSelected];
		[_selctButton6 addTarget:self action:@selector(changSelectAction:) forControlEvents:UIControlEventTouchUpInside];
		_selctButton6.tag = 106;
		_selctButton6.hidden = YES;
		[_selctButton6 setHitTestEdgeInsets:UIEdgeInsetsMake(-20, -20, -20, -20)];
	}
	return _selctButton6;
}


- (UIButton *)selctButton7 {
	if (!_selctButton7) {
		_selctButton7 = [UIButton buttonWithType:UIButtonTypeCustom];
		[_selctButton7 setImage:[UIImage imageNamed:@"not_select"] forState:UIControlStateNormal];
		[_selctButton7 setImage:[UIImage imageNamed:@"select"] forState:UIControlStateSelected];
		_selctButton7.tag = 107;
		[_selctButton7 addTarget:self action:@selector(changSelectAction:) forControlEvents:UIControlEventTouchUpInside];
		_selctButton7.hidden = YES;
		[_selctButton7 setHitTestEdgeInsets:UIEdgeInsetsMake(-20, -20, -20, -20)];
	}
	return _selctButton7;
}

@end

